﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace EntitySetBase
{
    public abstract class EntitySet : EntitySet<string>
    {
        public EntitySet()
        {
            Id = Guid.NewGuid().ToString();
        }
    }

    public abstract class EntitySet<TKey> : IEntitySet<TKey> where TKey : IConvertible, IEquatable<TKey>
    {
        [Column("id"), Key, Required, MaxLength(36), DatabaseGenerated(DatabaseGeneratedOption.None)]
        public TKey Id { get; set; }
    }
}
